import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import './index.styl'

interface Star {
  props: {
    tags: string[], // 渲染的数据
    readonly showMaxNum?: number // 最大展示数量
  }
}
class Star extends Component {
  constructor() {
    super(...arguments)
  }
  componentWillMount() {
    
  }
  render() {
    return (
      <View className='tags'>
        {
          this.props.tags.map((item, index) => (
            (this.props.showMaxNum && index < this.props.showMaxNum) && <Text className='tag' key={index}>{item}</Text>
          ))
        }
      </View>
    )
  }
}
export default Star